package 迭代器设计模式;

import java.util.List;

/**
 * 抽象迭代器
 */
public class ConcreteCollection implements ICollection {

    private List list;

    public ConcreteCollection(List list) {
        this.list = list;
    }

    @Override
    public boolean add(Object o) {
        return list.add(o);
    }

    @Override
    public boolean remove(Object o) {
        return list.remove(o);
    }

    @Override
    public Iterator iterate() {
        return new ConcreteIterator(list);
    }
}
